#include "DecoratedTypeDescription.h"

#include "ScriptCompiler/Description/TypeDescription.h"

bool SDecoratedTypeDescription::IsValid() const
{
    return BasicType != nullptr;
}

bool SDecoratedTypeDescription::IsGeneralizedType() const
{
    if(!BasicType)
    {
        return false;
    }
    return BasicType->IsGenerailizedClass();
}

bool SDecoratedTypeDescription::IsSameWith(const SDecoratedTypeDescription& Other) const
{
    if(BasicType == Other.BasicType)
    {
        return true;
    }

    return false;

}

CString SDecoratedTypeDescription::ToString() const
{
    if(BasicType)
    {
        return BasicType->GetSearchName();
    }
    else
    {
        return U"void";
    }
}

bool SDecoratedTypeDescription::IsValueType() const
{
    if(!BasicType)
    {
        assert(false&& "cant judge void type" );
        return false;       
    }

    return BasicType->IsValueType();
}
